package com.example.administrator.demorecyclerview;

import android.content.Context;
import android.graphics.Canvas;
import android.support.annotation.Nullable;
import android.support.v7.widget.RecyclerView;
import android.util.AttributeSet;
import android.util.Log;
import android.view.MotionEvent;
import android.view.View;

/**
 * Created by Administrator on 2017/11/20.
 */

public class MyRecyclerView extends RecyclerView {
    public MyRecyclerView(Context context) {
        super(context);
    }

    public MyRecyclerView(Context context, @Nullable AttributeSet attrs) {
        super(context, attrs);
    }

    public MyRecyclerView(Context context, @Nullable AttributeSet attrs, int defStyle) {
        super(context, attrs, defStyle);
    }


    @Override
    protected void onMeasure(int widthSpec, int heightSpec) {
        super.onMeasure(widthSpec, heightSpec);
    }

    @Override
    protected void onLayout(boolean changed, int l, int t, int r, int b) {
        super.onLayout(changed, l, t, r, b);
//        Log.i("@@","@@@@onLayout");

    }

    @Override
    protected void onSizeChanged(int w, int h, int oldw, int oldh) {
        super.onSizeChanged(w, h, oldw, oldh);
//        Log.i("@@","@@@@onSizeChanged:"+getChildCount());
    }

    @Override
    protected void dispatchDraw(Canvas canvas) {
        super.dispatchDraw(canvas);
    }

    //    @Override
//    public boolean onInterceptTouchEvent(MotionEvent e) {
//        try {
//            Thread.sleep(500);
//        } catch (InterruptedException e1) {
//            e1.printStackTrace();
//        }
//        Log.i("@@", "onInterceptTouchEvent:");
//        return super.onInterceptTouchEvent(e);
//    }
//
//
//    @Override
//    public boolean onTouchEvent(MotionEvent e) {
//        try {
//            Thread.sleep(200);
//        } catch (InterruptedException e1) {
//            e1.printStackTrace();
//        }
////        Log.i("@@", "onTouchEvent:");
//        return super.onTouchEvent(e);
//    }
//
//
//    //    @Override
////    public boolean startNestedScroll(int axes) {
////        boolean val = super.startNestedScroll(axes);
////        Log.i("@@", "startNestedScroll:" + val);
////        return val;
////    }
////
////    @Override
////    public boolean startNestedScroll(int axes, int type) {
////        boolean val = super.startNestedScroll(axes, type);
////        Log.i("@@", "startNestedScroll:" + val);
////        return val;
////    }
////
////    @Override
////    public void stopNestedScroll() {
////        super.stopNestedScroll();
////        Log.i("@@", "stopNestedScroll:");
////    }
////
////    @Override
////    public void stopNestedScroll(int type) {
////        super.stopNestedScroll(type);
////        Log.i("@@", "stopNestedScroll:");
////    }
//    @Override
//    public boolean dispatchNestedPreScroll(int dx, int dy, int[] consumed, int[] offsetInWindow) {
//        boolean val = super.dispatchNestedPreScroll(dx, dy, consumed, offsetInWindow);
//        Log.i("@@", "dispatchNestedPreScroll:" + val + ":" + dx + "," + dy);
//        return val;
//    }
//
//    @Override
//    public boolean dispatchNestedPreScroll(int dx, int dy, int[] consumed, int[] offsetInWindow, int type) {
//        boolean val = super.dispatchNestedPreScroll(dx, dy, consumed, offsetInWindow, type);
//        Log.i("@@", "dispatchNestedPreScroll:" + val + ":" + offsetInWindow[0] + "," + offsetInWindow[1]);
//        return val;
//    }
//
//
//    @Override
//    public boolean dispatchNestedPreFling(float velocityX, float velocityY) {
//        boolean val = super.dispatchNestedPreFling(velocityX, velocityY);
//        Log.i("@@", "dispatchNestedPreFling:" + val);
//        return val;
//    }

//    @Override
//    public boolean dispatchNestedScroll(int dxConsumed, int dyConsumed, int dxUnconsumed, int dyUnconsumed, int[] offsetInWindow) {
//        Log.i("@@", "dispatchNestedScroll:");
//        return super.dispatchNestedScroll(dxConsumed, dyConsumed, dxUnconsumed, dyUnconsumed, offsetInWindow);
//    }
//
//    @Override
//    public boolean dispatchNestedScroll(int dxConsumed, int dyConsumed, int dxUnconsumed, int dyUnconsumed, int[] offsetInWindow, int type) {
//        Log.i("@@", "dispatchNestedScroll:");
//        return super.dispatchNestedScroll(dxConsumed, dyConsumed, dxUnconsumed, dyUnconsumed, offsetInWindow, type);
//    }

//    @Override
//    public boolean dispatchNestedFling(float velocityX, float velocityY, boolean consumed) {
//        Log.i("@@", "dispatchNestedFling:");
//        return super.dispatchNestedFling(velocityX, velocityY, consumed);
//    }


}
